﻿<Window x:Class="Cronus.Windows.ProjectSetup"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        Title="Project Setup" Height="380" Width="400"
        Icon="/Cronus;component/Resources/FireCreature.ico" WindowStyle="ToolWindow"
        Activated="Window_Activated">
    <Grid>
        <Grid.ColumnDefinitions>
            <ColumnDefinition />
        </Grid.ColumnDefinitions>
        <Grid.RowDefinitions>
            <RowDefinition Height="40" />
            <RowDefinition Height="65" />
            <RowDefinition Height="40" />
            <RowDefinition />
        </Grid.RowDefinitions>
        
        <!--Allow users to add projects.-->
        <GroupBox Header="Add Project" Grid.Row="0">
            <Grid>
                <Grid.ColumnDefinitions>
                    <ColumnDefinition />
                    <ColumnDefinition />
                </Grid.ColumnDefinitions>
                <TextBox Name="_NewProjectTextBox" Grid.Column="0" />
                <Button Content="Add" Click="AddNewProject_Click" Grid.Column="1" />
            </Grid>
        </GroupBox>
        
        <!--Allow users to modify projects.-->
        <GroupBox Header="Select Project" Grid.Row="1">
            <Grid>
                <Grid.RowDefinitions>
                    <RowDefinition Height="22"/>
                    <RowDefinition Height="22"/>
                </Grid.RowDefinitions>
                <Grid.ColumnDefinitions>
                    <ColumnDefinition />
                    <ColumnDefinition />
                </Grid.ColumnDefinitions>
                
                <!--Allow the user to select a project to modify.-->
                <TextBlock Text="Select Project:" Grid.Row="0" Grid.Column="0"
                           VerticalAlignment="Center" />
                <ComboBox Name="_ProjectComboBox" VerticalAlignment="Center"
                              Grid.Row="0" Grid.Column="1"
                              SelectionChanged="ProjectComboBox_SelectionChanged">
                    <ComboBox.ItemTemplate>
                        <DataTemplate>
                            <TextBlock Text="{Binding Path=Name}" VerticalAlignment="Center" />
                        </DataTemplate>
                    </ComboBox.ItemTemplate>
                </ComboBox>
                
                <!--Add buttons to allow users to either save changes or delete the project.-->
                <Button Content="Save Changes" Click="SaveProject_Click" Name="_btnSaveProject"
                        Grid.Column="0" Grid.Row="1" VerticalAlignment="Center" />
                <Button Content="Delete" Click="DeleteProject_Click" Name="_btnDelete"
                        Grid.Column="1" Grid.Row="1" VerticalAlignment="Center" />
            </Grid>
        </GroupBox>
        
        <!--Allow users to change the name of the currently selected project.-->
        <GroupBox Header="Options" Grid.Row="2">
            <Grid>
                <Grid.ColumnDefinitions>
                    <ColumnDefinition />
                    <ColumnDefinition />
                </Grid.ColumnDefinitions>
                
                <TextBlock Text="Name:" Grid.Column="0" VerticalAlignment="Center" />
                <TextBox Name="_NameTextBox" Grid.Column="1" VerticalAlignment="Center"
                         TextChanged="NameTextBox_TextChanged" />
            </Grid>
        </GroupBox>
        
        <GroupBox Header="Task Mapping" Grid.Row="3">
            <Grid>
                <Grid.ColumnDefinitions>
                    <ColumnDefinition />
                    <ColumnDefinition Width="30"/>
                    <ColumnDefinition />
                </Grid.ColumnDefinitions>
                <Grid.RowDefinitions>
                    <RowDefinition Height="20" />
                    <RowDefinition />
                </Grid.RowDefinitions>
                
                <!--Add some labels so users know what the heck is going on.-->
                <TextBlock Grid.Row="0" Grid.Column="0"
                           VerticalAlignment="Center" HorizontalAlignment="Center"
                           Text="Mapped Tasks" />
                <TextBlock Grid.Row="0" Grid.Column="2"
                           VerticalAlignment="Center" HorizontalAlignment="Center"
                           Text="Unmapped Tasks" />
                
                <!--Add the list boxes to display the tasks.-->
                <ListBox Name="_MappedTasks" Grid.Row="1" Grid.Column="0"
                         SelectionMode="Multiple">
                    <ListBox.ItemTemplate>
                        <DataTemplate>
                            <TextBlock Text="{Binding Path=Name}" VerticalAlignment="Center" />
                        </DataTemplate>
                    </ListBox.ItemTemplate>
                </ListBox>
                <ListBox Name="_UnmappedTasks" Grid.Row="1" Grid.Column="2"
                         SelectionMode="Multiple">
                    <ListBox.ItemTemplate>
                        <DataTemplate>
                            <TextBlock Text="{Binding Path=Name}" VerticalAlignment="Center" />
                        </DataTemplate>
                    </ListBox.ItemTemplate>
                </ListBox>

                <!--Add a container for the buttons to transfer items between the two list boxes.-->
                <StackPanel Orientation="Vertical" Grid.Row="1" Grid.Column="1"
                            VerticalAlignment="Center" HorizontalAlignment="Center">
                    <Button Name="_AddSelected" Content="&lt;" Click="UpdateSelected_Click" />
                    <Button Content="&lt;&lt;" Click="AddAll_Click" IsEnabled="False" />
                    <Button Content="&gt;&gt;" Click="RemoveAll_Click" IsEnabled="False" />
                    <Button Name="_RemoveSelected" Content="&gt;" Click="UpdateSelected_Click" />
                    
                </StackPanel>
                
            </Grid>
        </GroupBox>

    </Grid>
</Window>
